resolve ambiguous calling of real_babl_log with va_args
authorPaul Fredrickson <p_fredrickson@hotmail.com>
Tue, 18 Mar 2014 03:17:43 +0000 (20:17 -0700)
committerDaniel Sabo <DanielSabo@gmail.com>
Thu, 20 Mar 2014 10:08:29 +0000 (03:08 -0700)
commite439557f9e89e159a9f8dd8043e89e843ac60d82
tree3378f6a074487c0fbdc6a0815726d2ec3907408a
parentffaef3a7c10412820a887e343a9452dcce8c9235
resolve ambiguous calling of real_babl_log with va_args

In babl-internal.h there are two different ways of calling real_babl_log.
One matches the macro definitions of babl_log which expects an arbitrary
number of parameters, and the other is to pass a va_list used to access
those parameters. The latter case can be found in the function definition
of babl_log when an appropriate macro definition is not selected.

It may be that some platforms implement varargs in such a way that
passing a va_list pointing to the params of another call stack is the
same as passing those parameters directly, but that definitely isn't
the case on mac OS X, where this results in corrupted strings when
calling babl_log or babl_fatal.

The solution here is to create a varargs-enabled version of real_babl_log
that accepts a va_list, and have all calls eventually call into that.

(This may not be seen under normal configurations. This was discovered
while trying to build with a hand-crafted config.h in Xcode.)
babl/babl-internal.h